import { createApi } from 'utils/requset'
import { BussinessList, PondList } from 'types'

/* 商业列表 */
export const getList = (data: BussinessList) => createApi('business/list', 'GET', data)

/* 公海池列表 */
export const getPonds = (data: PondList) => createApi('business/pool', 'GET', data)

/* 获取学科字典 */
export const getSubjects = () => createApi('system/dict/data/type/course_subject', 'GET')

/* 添加商机 */
export const addBussiness = (data: any) => createApi('business', 'POST', data)

/* 获取部门 */
export const getDept = () => createApi('system/dept/treeselect', 'GET')

/* 获取用户 */
export const getUser = (data: { deptId: number | string }) => createApi('system/user/listselect', 'GET', data)

/* 分配商机 */
export const assignBussiness = (data: { ids: Array<string>; userId: string }) => createApi('business/assignment', 'PUT', data)

/* 获取商机详情 */
export const getBusinessDetail = (data: { id: number }) => createApi('business/' + data.id, 'GET')

/*  批量捞取 */
export const bulkFishing = (data: { ids: any[]; userId: number }) => createApi('business/gain', 'PUT', data)
